
<?php if (basename($_SERVER["SCRIPT_FILENAME"], '.php')=="index") { ?>

<?php 

//error_reporting(E_ALL);
//ini_set('display_errors', '1');

?>

				<!--<p>&nbsp;</p>-->			
			<!-- right column (end) -->
			<?php if (isset($gsTimer)) $gsTimer->Stop() ?>
			</div>
	    </td>	
		</tr>
	</table>
	<!-- content (end) -->	
</div>

	<!-- footer (begin) --><!-- *** Note: Only licensed users are allowed to remove or change the following copyright statement. *** -->
	<div class="ewFooterRow">	
		<div class="ewFooterText">&nbsp;<?php echo $Language->ProjectPhrase("FooterText") ?></div>
		<!-- Place other links, for example, disclaimer, here -->		
	</div>
	<!-- footer (end) -->	

<?php } ?>

<script type="text/javascript">

function ajaxedittable(table,objectId,field,value)
{

//alert("ok");
$.get("/portlet.php",
		{app: "system",
		operation:"updatetable",
		objectId:objectId,
		table:table,
		field:field,
		value:value},
		   function(data){
               <?php unBlockUI(); ?>
		if (data=="ok") {
			//alert("Saved");
			//	location.reload(true);
			
			}
		else  alert("There was an error, please contact your administrator !");


		   });

<?php blockUI($var_portal_loading); ?>
	}


function changeOrder(direction,table,objectId,jobject){


	$.get("/portlet.php",
			{app: "system",
			operation:"changeOrder",
			objectId:objectId,
			table:table,
			direction:direction},
			   function(data){
	               <?php unBlockUI(); ?>
			if (data=="ok") {
			//alert("Saved");
				//	location.reload(true);
				var row = jobject.parents("tr:first");
if (direction=="Up") {
    row.insertBefore(row.prev());
} else {
    row.insertAfter(row.next());
}
				}
			else  alert("There was an error, please contact your administrator !");


			   });

	<?php blockUI($var_portal_loading); ?>

	return true;
}	
</script>


<script type="text/javascript">
 selected=null;
$("table[class^='ewTable'] tr").not(':first').hover(
  function () {
	  if (!$(this).is(selected)){
    $(this).css("background","#8D8D8D");
    $(this).css("color","white");}
  }, 
  function () {

	  if (!$(this).is(selected)){
    $(this).css("background","");
    $(this).css("color","");
    }
  }
);

$("table[class^='ewTable'] tr").not(':first').click(
		  function () {
			  if (selected)
			  {
			  selected.css("background","");
			  selected.css("color","");
			  }
			 // alert($(this).is(selected));
		    $(this).css("background","#8EB0E8");
		    $(this).css("color","black");
		    selected=$(this);
		    $(this).find("input[name='ButterflyPortal_sys_rec']").prop('checked', true);
		    //ButterflyPortal_sys_rec
		  }
		);

$("table[class^='ewTable'] tr").not('.ewTableRow').dblclick(
		  function () {
			
		    $(this).find("input[name='ButterflyPortal_sys_rec']").prop('checked', true);
			$("#View").click();
		  }
		);

function replaceAll(find, replace, str) {
	  return str.replace(new RegExp(find, 'g'), replace);
	}

	
function loadmaster(url)
{

	id=$("input[name='ButterflyPortal_sys_rec']:checked").val();

	url=replaceAll("####",id,url);
location=url;
	}
 
</script>

<?php	
				if (!isActive(getPortalId()))
{
	register_shutdown_function("SystemInfo","This portal is not yet active, please refer to the mail sent in you account to activate it .");
	?>
	<script>
	$(".ewContentColumn").remove();
	</script>
	<?php 
		}
	 ?>
<?php  if (!isLocal()) { ?>
<script type="text/javascript" >
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', '<?php echo getGoogleAnalyticsCode(); ?>']);

 // _gaq.push(['_setDomainName', '<?php echo $_SERVER['HTTP_HOST']; ?>']);
   _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
<?php } ?>
<?php //HidePortalLanguages(); 
	 ?>   

</body>
</html>
